﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using ClassLibrary.DAO;
using ClassLibrary.Entity;

public partial class ucControl_ucItemBySupplier : System.Web.UI.UserControl
{
    TblSupplierDAO supplierDAO = new TblSupplierDAO(Global.CONNECTION_STRING);

    protected void Page_Load(object sender, EventArgs e)
    {
        string id = Request.QueryString["id"];

        if (!IsPostBack)
        {
            if (id != null)
            {
                LoadMenuSupplie();
                LaodFormViewDetail();

            }
        }
    }

    private void LaodFormViewDetail()
    {
        string id = Request.QueryString["id"];
        frmViewDetail.DataSource = supplierDAO.GetSuppByID(Global.ConvertToInt(id));
        frmViewDetail.DataBind();

    }

    private void LoadMenuSupplie()
    {
        string id = Request.QueryString["id"];
        lvSuppliers.DataSource = supplierDAO.GetMenuChild(Global.ConvertToInt(id));
        lvSuppliers.DataBind();
    }
}
